use strict;
use warnings;

package Contact::AddressPhoneMap;

use base qw(My::DB::Object);

__PACKAGE__->meta->setup(
    table   => 'address_phone_map',
    columns => [
        'id'         => { 'type' => 'serial', 'primary_key' => 1, 'not_null' => 1 },
        'address_id' => { 'type' => 'int',    'not_null'    => 1 },
        'phone_id'   => { 'type' => 'int',    'not_null'    => 1 },
    ],
    relationships => [
        address => { type => 'many to one', class => 'Contact::Address', column_map => { 'address_id' => 'id' }, },
        phone   => { type => 'many to one', class => 'Contact::Phone',   column_map => { 'phone_id'   => 'id' }, },
    ],
);

1;
